import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { SGuildWarSignUpPlayer } from "../../../../../Message/Public/SGuildWarSignUpPlayer";
//class GuildWarPlayerCellRenderer
    
    export  class GuildWarPlayerCellRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(0, 0, 210, 2, this, "SplitLine");
            var loc1=GlobalStyle.getTextFormatCenter(GlobalStyle.textFormat1);
            this._tfName = ObjCreate.createTextField("", 0, 5, 110, 20, this, loc1);
            this._tfWarfare = ObjCreate.createTextField("", 133, 5, 60, 20, this, loc1);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (typeof arg1 === "sguildwarsignupplayer") 
            {
                this._player = arg1 as SGuildWarSignUpPlayer;
                this.updateView();
            }
            return;
        }

        /* internal  */updateView(): void
        {
            this._tfName.text = this._player.name;
            this._tfWarfare.text = this._player.warfare.toString();
            return;
        }

        /* internal */ /* var */_player: SGuildWarSignUpPlayer;

        /* internal */ /* var */_tfName: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfWarfare: Object /* flash.text.TextField */;
    }
